﻿<Window x:Class="PJ.AppPOS.Shell"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:tk="clr-namespace:Microsoft.Windows.Controls.Ribbon;assembly=RibbonControlsLibrary" 
    xmlns:cal="http://www.codeplex.com/CompositeWPF"
    Title="Dynamics AX Point of Sales" Closing="Window_Closing">
    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary x:Name="rdTheme"
                                    Source="/RibbonControlsLibrary;component/Themes/Office2007Silver.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>
    <DockPanel>
        <DockPanel DockPanel.Dock="Top">
            <tk:Ribbon DockPanel.Dock="Top">
                <tk:Ribbon.Resources>
                    <tk:RibbonCommand x:Key="NewGroup" LabelTitle="Créer" ToolTipTitle="Nouveau" ToolTipDescription="Créer un nouvel document" />
                    <tk:RibbonCommand x:Key="NewOrder" LabelTitle="Commande" ToolTipTitle="Commande" ToolTipDescription="Créer une nouvelle commande" />
                    <tk:RibbonCommand x:Key="NewQuotation" LabelTitle="Offre" ToolTipTitle="Offre de prix" ToolTipDescription="Créer une nouvelle offre de prix" />
                    <tk:RibbonCommand x:Key="NewPackingSlip" LabelTitle="Livraison" ToolTipTitle="Bon de livraison" ToolTipDescription="Créer un nouveau bon de livraison" />
                    <tk:RibbonCommand x:Key="NewInvoice" Executed="RibbonCommand_Executed"  LabelTitle="Facture" ToolTipTitle="Facture" ToolTipDescription="Créer une nouvelle facture" />
                    <tk:RibbonCommand x:Key="NewSale" LabelTitle="Comptant" ToolTipTitle="Vente au comptant" ToolTipDescription="Créer une nouvelle facture et faire l'encaissement du réglement" />
                    <tk:RibbonCommand x:Key="SearchGroup" LabelTitle="Rechercher" ToolTipTitle="Rechercher" ToolTipDescription="Effectuer une recheche" />
                    <tk:RibbonCommand x:Key="SearchCustomer" LabelTitle="Client" ToolTipTitle="Rechercher un client" ToolTipDescription="Rechercher un client en utilisant son identifiant, nom, téléphone ou par adresse" />
                </tk:Ribbon.Resources>
                <tk:RibbonTab Label="Ventes">
                    <tk:RibbonGroup Command="{StaticResource NewGroup}">
                        <tk:RibbonButton Command="{StaticResource NewSale}" />
                        <tk:RibbonButton Command="{StaticResource NewPackingSlip}" />
                        <tk:RibbonButton Command="{StaticResource NewInvoice}" />
                        <tk:RibbonButton Command="{StaticResource NewOrder}" />
                        <tk:RibbonButton Command="{StaticResource NewQuotation}" />
                    </tk:RibbonGroup>
                    <tk:RibbonGroup Command="{StaticResource SearchGroup}">
                        <tk:RibbonButton Command="{StaticResource SearchCustomer}" />
                    </tk:RibbonGroup>
                </tk:RibbonTab>
                <tk:RibbonTab Label="Achats"/>
                <tk:RibbonTab Label="Stock">
                </tk:RibbonTab>
                <tk:RibbonTab Label="Paramètres" >
                    <tk:RibbonGroup>
                        <tk:RibbonLabel Content="Select a theme:" />
                        <tk:RibbonComboBox x:Name="rcbThemes"
                                      Width="120"
                                      IsReadOnly="False"
                                      SelectedIndex="0"
                                      SelectionChanged="rcbThemes_SelectionChanged">
                            <tk:RibbonComboBoxItem Content="Office2007Silver" />
                            <tk:RibbonComboBoxItem Content="Office2007Black" />
                            <tk:RibbonComboBoxItem Content="Office2007Blue" />
                        </tk:RibbonComboBox>
                    </tk:RibbonGroup>
                </tk:RibbonTab>

                <tk:Ribbon.QuickAccessToolBar>
                    <tk:RibbonQuickAccessToolBar>
                        <tk:RibbonButton tk:RibbonQuickAccessToolBar.Placement="InCustomizeMenuAndToolBar" />
                    </tk:RibbonQuickAccessToolBar>
                </tk:Ribbon.QuickAccessToolBar>
            </tk:Ribbon>
            <ItemsControl DockPanel.Dock="Top" Name="HeaderRegion" cal:RegionManager.RegionName="HeaderRegion" />
        </DockPanel>
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="200"/>
                <ColumnDefinition/>
            </Grid.ColumnDefinitions>
            <DockPanel Grid.Column="0" Grid.ColumnSpan="1"  >
                <ItemsControl DockPanel.Dock="Top" Name="LeftRegion1" cal:RegionManager.RegionName="LeftRegion1" >
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <DockPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>

                <ItemsControl Name="LeftRegion2" cal:RegionManager.RegionName="LeftRegion2" >
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <DockPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </DockPanel>
            <GridSplitter Background="#FF77B6EB" Width="2"/>
            <DockPanel Grid.Column="1" Grid.ColumnSpan="1"  >
                <ItemsControl DockPanel.Dock="Top" Name="MainRegion1" cal:RegionManager.RegionName="MainRegion1">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <DockPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
                <ItemsControl Name="MainRegion2" cal:RegionManager.RegionName="MainRegion2">
                    <ItemsControl.ItemsPanel>
                        <ItemsPanelTemplate>
                            <DockPanel/>
                        </ItemsPanelTemplate>
                    </ItemsControl.ItemsPanel>
                </ItemsControl>
            </DockPanel>
        </Grid>
    </DockPanel>
</Window>
